package com.fay.designPattern.principles.solid;

/**
 * @Title:
 * @Description:
 * @Author Fay Wang
 * @Date 2022/3/1 17:39
 * @Version 1.0
 */
public class ErrorAlertHandler extends OcpAlertHandler{
    public ErrorAlertHandler(AlertRule rule, Notification notification) {
        super(rule, notification);
    }

    @Override
    public void check(ApiStatInfo apiStatInfo) {
        if (apiStatInfo.getErrorCount() > rule.getMatchedRule(apiStatInfo.getApi()).getMaxErrorCount()) {
            notification.notify(NotificationEmergencyLevel.SEVERE, "..");
        }
    }
}
